#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: liang kang
@contact: gangkanli1219@gmail.com
@time: 2018/5/29 17:36
@desc: 
"""
from seg.back.background import BackGround
from seg.airway.airway import Airway
from utils.data import Image
from utils.log import get_console_logger

logger = get_console_logger('LungSeg', 1)

image = Image()
image.init_with_dcm(
    'D:\\data\\lidc\\b\\LIDC-IDRI-0111\\1.3.6.1.4.1.14519.5.2.1.6279.6001.361004729625204263297457202086\\000000'
)
if image.break_scan:
    print('break scan')
back = BackGround(image, './', logger=logger)
back.update()
if back.msg is not None:
    print(back.msg)

airway = Airway(back.mask, './', logger=logger)
airway.update()
if airway.msg is not None:
    print(airway.msg)
